<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>大乐透号码生成器</title>
    <style>
        /* 全局样式 */
        body {
            font-family: 'Segoe UI', 'Arial', sans-serif;
            background: linear-gradient(135deg, #e0eafc, #cfdef3); /* 渐变背景 */
            padding: 20px;
            margin: 0;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        /* 容器样式 */
        div {
            background-color: #ffffff;
            border: none;
            border-radius: 10px;
            padding: 15px;
            margin-bottom: 15px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影效果 */
            width: 100%;
            max-width: 600px; /* 限制最大宽度 */
            transition: transform 0.2s ease; /* 悬停动画 */
        }

        div:hover {
            transform: translateY(-2px); /* 轻微上移 */
        }

        /* 最新开奖号码样式 */
        .latest-result {
            background: linear-gradient(to right, #fff3cd, #ffeeba); /* 渐变背景 */
            border-left: 4px solid #ffca2c; /* 左侧强调色 */
            font-weight: bold;
            color: #856404;
        }

        /* 段落样式 */
        p {
            font-size: 16px;
            color: #444;
            margin: 0;
            line-height: 1.5;
        }

        /* 标题效果（可选） */
        .latest-result p::before {
            content: "🎉 ";
        }

        /* 表单和按钮样式 */
        form {
            text-align: center;
            margin-top: 20px;
        }

        input[type="submit"] {
            background: linear-gradient(45deg, #007bff, #00c6ff); /* 渐变按钮 */
            color: white;
            border: none;
            padding: 10px 25px;
            border-radius: 25px; /* 圆润按钮 */
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
            transition: all 0.3s ease;
        }

        input[type="submit"]:hover {
            background: linear-gradient(45deg, #0056b3, #009bfc);
            box-shadow: 0 4px 8px rgba(0, 123, 255, 0.5);
            transform: scale(1.05); /* 轻微放大 */
        }

        /* 响应式设计 */
        @media (max-width: 600px) {
            div {
                padding: 10px;
                margin-bottom: 10px;
            }
            p {
                font-size: 14px;
            }
            input[type="submit"] {
                padding: 8px 20px;
                font-size: 14px;
            }
        }
    </style>
</head>

<body>
    <!-- 显示最新开奖号码 -->
    {% if latest_result %}
    <div class="latest-result">
        <p>最新开奖号码:
           前区: {{ latest_result[:5] | join(', ') }},
           后区: {{ latest_result[5:] | join(', ') }}
        </p>
    </div>
    {% endif %}

    <!-- 显示生成的号码 -->
    {% for result in results %}
    <div>
        <p>{{ result }}</p>
    </div>
    {% endfor %}

    <form action="/" method="post">
        <input type="submit" value="重新生成">
    </form>
</body>
</html>